﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mwc="clr-namespace:Mongoose.Windows.Controls">

    <Style TargetType="{x:Type mwc:PathButton}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type mwc:PathButton}">
                    <Grid Background="Transparent" SnapsToDevicePixels="True">
                        <Border Background="{TemplateBinding BorderThickness}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                SnapsToDevicePixels="True">
                            <Path StrokeThickness="{TemplateBinding StrokeThickness}" 
                                  Stroke="{TemplateBinding Foreground}" 
                                  Fill="{TemplateBinding Background}" 
                                  Data="{TemplateBinding PathData}"
                                  SnapsToDevicePixels="True">
                                <Path.Effect>
                                    <DropShadowEffect x:Name="glowEffect"
                                                      ShadowDepth="0"
                                                      Color="White"
                                                      Opacity="0"
                                                      BlurRadius="5"/>
                                </Path.Effect>
                            </Path>
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>

                        <EventTrigger RoutedEvent="MouseEnter">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation From="0" To="1" Duration="00:00:00.2" 
                                                     Storyboard.TargetName="glowEffect" 
                                                     Storyboard.TargetProperty="Opacity"></DoubleAnimation>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>

                        <EventTrigger RoutedEvent="MouseLeave">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation From="1" To="0" Duration="00:00:00.2" 
                                                     Storyboard.TargetName="glowEffect" 
                                                     Storyboard.TargetProperty="Opacity"></DoubleAnimation>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>